#include <cstdio>
using namespace std;

#define STUDENT_NUMBER 10
#define CLASS_NUMBER 3
#define NAME_LENGTH 19

typedef struct {
    int num;
    char name[NAME_LENGTH + 1];
    int score[CLASS_NUMBER];
} student;

int CalculateScore(student x) {return x.score[0] + x.score[1] + x.score[2];}

int main()
{
    student student_list[STUDENT_NUMBER];
    for (int i = 0; i < STUDENT_NUMBER; i++) {
        scanf(" %d", &student_list[i].num);
        scanf(" %s", student_list[i].name);
        for (int j = 0; j < CLASS_NUMBER; j++)
            scanf(" %d", &student_list[i].score[j]);
    }

    double average[CLASS_NUMBER] = {0};
    for (int i = 0; i < STUDENT_NUMBER; i++) 
        for (int j = 0; j < CLASS_NUMBER; j++)
            average[j] += student_list[i].score[j];
    
    for (int i = 0; i < CLASS_NUMBER; i++) {
        average[i] = average[i] / (double)STUDENT_NUMBER;
        printf("%.2f ", average[i]);
    }
    printf("\n");

    int student_pos = 0;
    for (int i = 1; i < STUDENT_NUMBER; i++) {
        if (CalculateScore(student_list[student_pos]) < CalculateScore(student_list[i]))
            student_pos = i;
    }
    printf("%d %s %d %d %d\n", student_list[student_pos].num, student_list[student_pos].name,
           student_list[student_pos].score[0], student_list[student_pos].score[1], student_list[student_pos].score[2]);

    return 0;
}

